<template>
  <div>
    <a-select
      show-search
      :value="value"
      placeholder="请选择"
      :default-active-first-option="false"
      :filter-option="false"
      :not-found-content="dataList.length>0?null:'暂无数据'"
      @search="handleSearch"
      @change="goodChange"
      @popupScroll="handlePopScroll">
      <a-select-option :value="item[options.key]" v-for="item in dataList" :key="item[options.key]">
        {{item[options.name]}}
      </a-select-option>
    </a-select>
  </div>
</template>

<script>
export default {
  name: "drop-down-search-select",
  props: {
    value: String,
    options: {
      type: Object,
      default: {
        // key: 'id',
        // name: 'name'
      }
    },
    api: Object
  },
  data() {
    return {
      dataList: []
    }
  },
  methods: {
    change(e) {
      let val = e.target.value;
      this.$emit("input", val);
    },
  },
};
</script>
